package ArrayListExercise;

import java.util.List;

public class Test {
    public static void main(String[] args) {
//        List<Integer> list=new ArrayList<>();
//        list.add(1);
//        list.add(2);
//        list.add(3);
//        list.display();

        ArrayList arrayList=new ArrayList();
        System.out.println("====add(int data)====");
        arrayList.add(1);
        arrayList.add(2);
        arrayList.add(3);
        arrayList.add(4);
        arrayList.display();
        System.out.println("====add(int pos,int data)====");
        arrayList.add(0,10);
        arrayList.add(1,100);
//        arrayList.add(10,200);
        arrayList.display();
        System.out.println("====contains(int toFind)====");
        System.out.println(arrayList.contains(10));
        System.out.println("====index(int toFind)====");
        System.out.println(arrayList.indexOf(1000));
        System.out.println("====get(int pos)====");
        System.out.println(arrayList.get(4));
        System.out.println("====set(int pos)====");
        arrayList.set(5,88);
        arrayList.display();
        System.out.println("====remove(int toRemove)====");
        arrayList.remove(100);
        arrayList.remove(3);
//        arrayList.remove(4);
        arrayList.display();
        System.out.println("====size()====");
        System.out.println(arrayList.size());
        arrayList.clear();
        System.out.println(arrayList.size());
    }
}
